package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 弹窗类型(1-商家入驻/2-商户入驻)
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum PopTypeEnum {

    BUSINESS_ENTER(1, "商家入驻"),
    MERCHANT_ENTER(2, "商户入驻"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    PopTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static PopTypeEnum typeOf(Integer value) {
        PopTypeEnum[] values = PopTypeEnum.values();
        for (PopTypeEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static PopTypeEnum typeOf(String name) {
        PopTypeEnum[] values = PopTypeEnum.values();
        for (PopTypeEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }


}
